package com.schoolET.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.schoolET.entity.GoodsAndType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 商品分类 Mapper 接口
 * </p>
 *
 * @author le
 * @since 2024-06-07
 */
@Mapper
public interface GoodsAndTypeMapper extends BaseMapper<GoodsAndType> {
    @Select("SELECT t.type FROM goods_and_type gt \n" +
            "\tLEFT JOIN goods_type t ON gt.goods_type_id=t.id\n" +
            "\tWHERE gt.goods_id = ${goodsId}")
    List<String> selectGoodsTypeByGoodsId(Integer goodsId);
}
